/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package afroschool.beans;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author AUTRES
 */
@Entity
@Table(name = "province")
@NamedQueries({@NamedQuery(name = "Province.findByCode", query = "SELECT p FROM Province p WHERE p.code = :code"), @NamedQuery(name = "Province.findByPaycode", query = "SELECT p FROM Province p WHERE p.paycode = :paycode"), @NamedQuery(name = "Province.findByNom", query = "SELECT p FROM Province p WHERE p.nom = :nom")})
public class Province implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "code", nullable = false)
    private String code;
    @Column(name = "Pay_code")
    private String paycode;
    @Column(name = "nom")
    private String nom;

    public Province() {
    }

    public Province(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getPaycode() {
        return paycode;
    }

    public void setPaycode(String paycode) {
        this.paycode = paycode;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (code != null ? code.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Province)) {
            return false;
        }
        Province other = (Province) object;
        if ((this.code == null && other.code != null) || (this.code != null && !this.code.equals(other.code))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "afroschool.beans.Province[code=" + code + "]";
    }

}
